package service

import (
	"github.com/gin-gonic/gin"
	xerr "github.com/pkg/errors"
	"homework/internal/data"
)

func Pong(c *gin.Context) {
	rtn , err  := data.GetMockReturn()

	if err != nil{
		c.JSON(300, gin.H{
			"message": rtn,
			"error": xerr.Cause(err).Error(),//获取root cause
		})
		return
	}

	c.JSON(200, gin.H{
		"message": rtn,
		"error": "",
	})
	return
}
